package com.cloudcentral.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cloudcentral.entity.UserAudit;

/**
 * <p>
 * 待审核用户表 Mapper 接口
 * </p>
 *
 * @author Administrator
 * @since 2023-10-27
 */
public interface UserAuditMapper extends UserAuditBaseMapper {
  default UserAudit getByPhone(String phone, Long platformId) {
    QueryWrapper<UserAudit> queryWrapper = new QueryWrapper<>();
    queryWrapper.eq("platform_id", platformId).eq("phone", phone);
    return selectOne(queryWrapper);
  }

  default UserAudit getByUsername(String username, Long platformId) {
    QueryWrapper<UserAudit> queryWrapper = new QueryWrapper<>();
    queryWrapper.eq("platform_id", platformId).eq("username", username);
    return selectOne(queryWrapper);
  }
}
